import { S } from '../s';
import { IPSSysPFPlugin } from '../res/ipssys-pfplugin';
import { IPSSysValueRule } from './ipssys-value-rule';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSSysValueRuleImpl
  extends PSModelObjectImpl
  implements IPSSysValueRule
{
  get codeName(): string {
    return this.M.codeName;
  }

  get customObject(): string {
    return this.M.customObject;
  }

  get customParams(): string {
    return this.M.customParams;
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get regExCode(): string {
    return this.M.regExCode;
  }

  get regExCode2(): string {
    return this.M.regExCode2;
  }

  get regExCode3(): string {
    return this.M.regExCode3;
  }

  get regExCode4(): string {
    return this.M.regExCode4;
  }

  get ruleInfo(): string {
    return this.M.ruleInfo;
  }

  get ruleTag(): string {
    return this.M.ruleTag;
  }

  get ruleTag2(): string {
    return this.M.ruleTag2;
  }

  get ruleType(): 'SCRIPT' | 'REG' | 'CUSTOM' | 'REGEX' {
    return this.M.ruleType;
  }

  get scriptCode(): string {
    return this.M.scriptCode;
  }

  get enableBackend(): boolean {
    return this.M.enableBackend;
  }

  get enableFront(): boolean {
    return this.M.enableFront;
  }
  get cls(): string {
    return 'PSSysValueRuleImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1b) return true;
    return super.instanceof(cls);
  }
}
